This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(ggplot2)
aisc2024 <- read.csv("aisc.csv", header = TRUE)
aisc2024 |> # Start with the data
ggplot( # Set up the plot.
aes(
x = tempo,
y = arousal,
size = instrumentalness,
colour = danceability
)
) +
geom_point() + # Scatter plot.
geom_rug(linewidth = 0.1) + # Add 'fringes' to show data distribution.
geom_text( # Add text labels from above.
x = 121,
y = 4.91,
label = "Onda Corta - Sud America",
size = 3, # Override size (not loudness here).
hjust = "left", # Align left side of label with the point.
vjust = "center", # Align vertical centre of label with the point.
angle = 30 # Rotate the text label
) +
scale_x_continuous( # Fine-tune the x axis.
limits = c(0, 200),
breaks = c(50, 100, 150, 200), # Specify grid lines
minor_breaks = NULL # Remove 'minor' grid lines.
) +
scale_y_continuous( # Fine-tune the y axis in the same way.
limits = c(1, 9),
breaks = c(1, 5, 9),
minor_breaks = NULL
) +
scale_colour_viridis_c() + # Use the popular viridis colour palette.
scale_size_continuous( # Fine-tune the sizes of each point.
trans = "exp", # Use an exp transformation to emphasise loud..
guide = "none" # Remove the legend for size.
) +
theme_light() + # Use a simpler theme.
labs( # Make the titles nice.
x = "Tempo",
y = "Arousal",
colour = "Danceability"
)test
artist title danceability
1 Yapzech We Are Stepping In 0.6339566
2 HEL9000 binary-b1o0d 0.4310685
3 Yun+More Do AIs Dream 0.3005951
4 Emo Hues Moonlit Tears 0.4309452
5 Almost Human Yesterday 0.8798282
6 KicKRaTT KaOzBrD ARBOREAL 0.8517656
7 Ceremony Shadows Sunfall 0.5178320
8 Vonpsyche The Nature 0.2069548
9 Onda Corta Sud America 0.5871841
10 swansong Ochiai Toshiya 0.7484748
11 PHANTOMSCHMERZ Tanz Mit Der KI 0.3957726
12 TIKHET All Machineries 0.7838064
13 Error305 Heart Not Found 0.3544357
14 CracksInTheReal Petrushka Rising 0.7255723
15 Forest Little Music The Laziness Complex 0.4532424
16 Robots Make Music Whatever 0.5141004
17 Seva M Defy the Odds (Again) 0.7134851
18 mFriendOB3 Danish Vanish 0.4082446
19 Asian Culture Research Team Overfitting 0.5775374
20 KeRa Echoes Of The Synthetic Forest 0.5627679
21 Dadabots Genre Cannon 0.6419406
22 Pol Wagner Awakening 0.7298880
23 Ziinan Signal Voyage 0.7222863
24 StriderQED Inspiration 0.7432976
25 ETFM Wakeup 0.6344830
26 GANTASMO Natures Tomb 0.3984531
27 Botuoso RabbitHole 0.6971996
28 The Grand Wamenawers Toxic 0.8210198
29 The Rockbots Generative Love 0.4475500
30 Genealogy Lalala 0.4659576
31 DJ Swami One Mantra 0.5641023
32 Jenny Perelli Lets Fight 0.3156697
valence arousal instrumentalness tempo
1 4.252057 4.446585 0.8116079 121
2 3.764513 4.892605 0.6605874 155
3 3.587308 3.730796 0.8866421 154
4 3.509241 4.716523 0.5294363 118
5 3.630578 3.972751 0.8130572 154
6 3.759634 4.533846 0.5345818 116
7 3.546809 4.202670 0.5868522 154
8 3.537997 4.088050 0.5475702 154
9 3.754198 4.914463 0.3986959 121
10 3.427669 4.060219 0.4817626 116
11 3.289894 4.116500 0.6334715 75
12 3.271581 4.107907 0.6224679 64
13 3.822791 4.858078 0.4049374 75
14 3.394381 4.079172 0.6595098 85
15 3.884343 3.755157 0.9040143 154
16 3.910835 4.688392 0.5422015 87
17 4.172775 4.762912 0.4416753 97
18 3.640845 4.221984 0.5574242 75
19 3.706505 4.273816 0.6660838 121
20 3.351331 4.095325 0.7273520 154
21 3.972117 4.623346 0.7339450 140
22 3.692147 4.557771 0.5190139 80
23 4.330293 4.568987 0.7440484 138
24 4.276304 4.593785 0.5234275 67
25 4.164796 4.377752 0.7963970 116
26 3.340126 4.012445 0.5803508 90
27 3.268177 4.031115 0.5864089 77
28 4.210932 4.479538 0.6482085 63
29 4.135867 4.898949 0.3695597 75
30 3.689864 4.714108 0.6154362 121
31 3.021905 3.790338 0.6847970 154
32 3.653926 4.386634 0.5916983 132
test
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.